The green (5577 \AA) and red-doublet (6300, 6364 \AA) lines are prompt emissions of metastable oxygen atoms in the $^1$S and $^1$D states, respectively, that have been observed in several comets. The value of intensity ratio of green to red-doublet (G/R ratio) of 0.1 has been used as a benchmark to identify the parent molecule of oxygen lines as H$_2$O. A coupled chemistry-emission model is developed to study the production and loss mechanisms of O($^1$S) and O($^1$D) atoms and the generation of red and green lines in the coma of C/1996 B2 Hyakutake. The G/R ratio depends not only on photochemistry, but also on the projected area observed for cometary coma, which is a function of the dimension of the slit used and geocentric distance of the comet. Calculations show that the contribution of photodissociation of H$_2$O to the green (red) line emission is 30 to 70% (60 to 90%), while CO$_2$ and CO are the next potential sources contributing 25 to 50% ($<$5%). The ratio of the photo-production rate of O($^1$S) to O($^1$D) would be around 0.03 ($\pm$ 0.01) if H$_2$O is the main source of oxygen lines, whereas it is $\sim$0.6 if the parent is CO$_2$. Our calculations suggest that the yield of O($^1$S) production in the photodissociation of H$_2$O cannot be larger than 1%. The model calculated radial brightness profiles of the red and green lines and G/R ratios are in good agreement with the observations made on comet Hyakutake in March 1996.